package kr.hkit.powerjava.chther26;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Properties;
import java.util.Scanner;

import kr.hkit.powerjava.chther24.work2.dao.DerpartmentDao;
import kr.hkit.powerjava.chther24.work2.dao.StudentDao;
import kr.hkit.powerjava.chther24.work2.service.ServiceDerpartment;
import kr.hkit.powerjava.chther24.work2.service.ServiveStudent;
import kr.hkit.powerjava.chther26.common.ConnectionFactory;
import kr.hkit.powerjava.chther26.common.DbUtil;
import kr.hkit.powerjava.chther26.dao.DepartmentDAO;
import kr.hkit.powerjava.chther26.dto.Department;
import kr.hkit.powerjava.chther26.dto.Employee;
import kr.hkit.powerjava.chther26.service.AbsService;
import kr.hkit.powerjava.chther26.service.DepartmentService;
import kr.hkit.powerjava.chther26.service.EmployeeService;

public class TestMain {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Connection connection = ConnectionFactory.getConnection();
		
		boolean flag = true;
		while (flag) {
			System.out.println("1. Department 2. Employee 3. 종료");
			switch (sc.nextInt()) {
				case 1:
					AbsService<Department> deptSvc = new DepartmentService(sc,connection); //dep
					deptSvc.prnMenu();
					break;
				case 2:
					AbsService<Employee> empSvc = new EmployeeService(sc,connection);  //emp
					empSvc.prnMenu();
					break;
				default:
					flag = false;
			}
		}
		
		DbUtil.close(connection);

	}
}
